package com.souku.finance.application.ui.mine;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.souku.finance.application.R;
import com.souku.finance.application.base.BaseActivity;
import com.souku.finance.application.ui.more.BankCard2Activity;
import com.souku.finance.application.utils.ViewUtil;

/**
 * Created by Android on 2016/12/19.
 */

public class RechargrActivity extends BaseActivity implements View.OnClickListener {

    protected RelativeLayout topBack;
    protected TextView topTitle;
    protected EditText etBankcard;
    protected ImageView ivDelet;
    protected LinearLayout llCard;
    protected TextView tvCard;
    Button btnRecharg;

    @Override
    public void internet() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.setContentView(R.layout.act_recharge);
        initView();
        topTitle.setText("充值");
        ViewUtil.setDelete(etBankcard, ivDelet, null);
    }

    @Override
    public void onClick(View view) {
        if (view.getId() == R.id.top_back) {
            onBackPressed();
        } else if (view.getId() == R.id.btn_recharg) {
            Intent intent = new Intent(this, RechargWebActivity.class);
            String amount = etBankcard.getText().toString();
            intent.putExtra("amount", amount);
            startActivity(intent);
        } else if (view.getId() == R.id.tv_card) {
            Intent intent = new Intent(this, BankCard2Activity.class);
            startActivity(intent);
        }
    }

    private void initView() {
        topBack = (RelativeLayout) findViewById(R.id.top_back);
        topBack.setOnClickListener(RechargrActivity.this);
        topTitle = (TextView) findViewById(R.id.top_title);
        etBankcard = (EditText) findViewById(R.id.et_bankcard);
        ivDelet = (ImageView) findViewById(R.id.iv_delet);
        btnRecharg = (Button) findViewById(R.id.btn_recharg);
        llCard = (LinearLayout) findViewById(R.id.ll_card);
        tvCard.setOnClickListener(RechargrActivity.this);
        btnRecharg.setOnClickListener(this);
        tvCard.setOnClickListener(this);
    }
}
